package com.lml.jdk8.test02;

import java.util.function.Consumer;

/**
 * @author Administrator
 * @date 2020/2/26 18:02
 * Description:
 */
public interface SpendMoney {
    void buy(double money);
}

class Demo {
    public static void main(String[] args) {
        Consumer<Double> consumer = money -> System.out.println("花掉了" + money + "元");
        buySomething(2990, consumer);
    }

    static void buySomething(double money, Consumer<Double> consumer) {
        consumer.accept(money);
    }
}
